package com.iengoo.day08.entity;

import java.sql.Time;

/**
 * @author zpym
 * @CopyRight (C) http://www.iengoo.com
 * @brief 车票实体
 * @email 122162005@qq.com
 * @date 2019-01-18 11:21
 */
public class Ticket {
    private int id;  // 属性的权限有四种 private default protected public
    private int price;
    private Time startTime;
    private String startStation;
    private String stopStation;
    private int surplusTicket;
    private String type;

    public Ticket() {
    }

    public Ticket(int price, Time startTime, String startStation, String stopStation, int surplusTicket, String type) {
        this.price = price;
        this.startTime = startTime;
        this.startStation = startStation;
        this.stopStation = stopStation;
        this.surplusTicket = surplusTicket;
        this.type = type;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getId() {
        return id;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public Time getStartTime() {
        return startTime;
    }

    public void setStartTime(Time startTime) {
        this.startTime = startTime;
    }

    public String getStartStation() {
        return startStation;
    }

    public void setStartStation(String startStation) {
        this.startStation = startStation;
    }

    public String getStopStation() {
        return stopStation;
    }

    public void setStopStation(String stopStation) {
        this.stopStation = stopStation;
    }

    public int getSurplusTicket() {
        return surplusTicket;
    }

    public void setSurplusTicket(int surplusTicket) {
        this.surplusTicket = surplusTicket;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    /**
     * 将对象转换成字符串
     *
     * @return
     */
//    public String toString() {
//        return "id : " + this.id + ", price: " + this.price;
//    }


    public String toString() {
        return "Ticket{" +
                "id=" + id +
                ", price=" + price +
                ", startTime=" + startTime +
                ", startStation='" + startStation + '\'' +
                ", stopStation='" + stopStation + '\'' +
                ", surplusTicket=" + surplusTicket +
                ", type='" + type + '\'' +
                '}';
    }
}
